define([],function(){
    var tpl = {};

    tpl.init = function(){
        var html = '';
        html += list();
        return html;
    };
    tpl.topStatistics = function(){
        return topStatistics();
    }
    tpl.bottomStatistics = function(){
        return bottomStatistics();
    }

    var list = function(){
        return  '<script id="nutrition_applicationList" type="text-html">'+
                '{{each list as value i}}'+
                '   <div class="monitor-user-card click-able" ptSchemeId="{{value.ptSchemeId}}" userId="{{value.userId}}" phone = "{{value.phoneNo}}">'+
                '       <div class="card-top">'+
                '           <div class="clearfix">'+
                '               <div class="pull-left sex-title">'+
                '                   <img src="page/nutrition/imgs/{{if value.gender=="F"}}women{{else}}man{{/if}}.png" alt="头像"/>'+
                '               </div>'+
                '               <div class="pull-left">'+
                '                   <font class="user-name ellipsis-1">{{value.userName}}</font><br/>'+
                '                   <font class="create-time">录入时间:{{value.createTime}}</font>'+
                '               </div>'+
                '               <div class="pull-right monitor-time">'+
                '                   <div>{{if value.status =="1"}}正常{{else if value.status =="4"}}终止{{/if}}</div>'+
                '               </div>'+
                '           </div>'+
                '           <div class="scheme-name ellipsis-1">{{value.ptSchemeName}}</div>'+
                '       </div>'+
                '       <div class="card-bottom">'+
                '           <div class="stage-name ellipsis-1" style="width:{{value.stageWidth}};margin-left:{{value.stageMarginWidth}};">'+
                '           {{if value.currentStageName}}'+
                '               <i class="fa fa-flag" aria-hidden="true"></i> {{value.currentStageName}}'+
                '           {{/if}}'+
                '           </div>'+
                '           <div class="stage-box">'+
                '               {{each value.stageArr as item j}}'+
                '                   <span style="width:{{value.stageWidth}};" {{if item == 1}}class="nowStage"{{/if}}></span>'+
                '               {{/each}}'+
                '           </div>'+
                '       </div>'+
                '   </div>'+
                '{{/each}}'+
                '{{each fillSpace as value i}}'+
                '   <div class="monitor-user-card"></div>'+
                '{{/each}}'+
                '</script>';
    };
    var topStatistics = function(){
        return  '<script id="nutrition_application_topStatistics" type="text-html">'+
                '   <div id="addNutritionScheme" class="monitor-report-card add-nutrition-scheme">'+
                '       <div class="col-md-12 text-center">'+
                '           <i class="fa fa-plus monitor-report-icon"></i>'+
                '           <div class="monitor-report-label">添加营养方案</div>'+
                '       </div>'+
                '   </div>'+
                '   <div class="monitor-report-card">'+
                '       <div class="col-md-3">'+
                '           <i class="fa fa-line-chart monitor-report-icon"></i>'+
                '       </div>'+
                '       <div class="col-md-9 text-right">'+
                '           <div class="monitor-report-val">{{todayNumber}}</div>'+
                '           <div class="monitor-report-label">今日新增患者</div>'+
                '       </div>'+
                '   </div>'+
                '   <div class="monitor-report-card">'+
                '       <div class="col-md-3">'+
                '           <i class="fa fa-bar-chart monitor-report-icon"></i>'+
                '       </div>'+
                '       <div class="col-md-9 text-right">'+
                '           <div class="monitor-report-val">{{managerMumber}}</div>'+
                '           <div class="monitor-report-label">管理中患者总数</div>'+
                '       </div>'+
                '   </div>'+
                '   <div class="monitor-report-card">'+
                '       <div class="col-md-3">'+
                '           <i class="fa fa-area-chart monitor-report-icon"></i>'+
                '       </div>'+
                '       <div class="col-md-9 text-right">'+
                '           <div class="monitor-report-val">{{pushNumber}}</div>'+
                '           <div class="monitor-report-label">方案推送总次数</div>'+
                '       </div>'+
                '   </div>'+
                '</script>';
    }
    var bottomStatistics = function(){
        return  '<script id="nutrition_application_bottomStatistics" type="text-html">'+
                '   <p>全部患者总数<span class="totalNum">{{allNumber}}</span>次</p>'+
                '</script>';
    }

    return tpl;
});